#include "Server.hpp"
#include "TcpConnection.hpp"

namespace wd
{

Server::Server(const string &ip,unsigned short port)
:_acceptor(ip,port)
,_loop(_acceptor)
{}

void Server::start(){
    _acceptor.ready();
    _loop.loop();
}

void Server::stop(){
_loop.closeLoop();
}

void Server::setCallBack(const CallBack& cb1,
                         const CallBack& cb2,
                         const CallBack& cb3)
{
    _loop.setCallBack(cb1,cb2,cb3);
}

}//end of namespace
